package com.cabd.web.servlet;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.cabd.domain.Folder;
import com.cabd.service.FolderService;
import com.cabd.service.impl.FolderServiceImpl;

public class AdminHomeServlet extends HttpServlet {

	private static final long serialVersionUID = 1L;

	public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		FolderService folderService = new FolderServiceImpl();
		List<Folder> allFolders = folderService.findAllService();
		request.setAttribute("allFolders", allFolders);
		request.getRequestDispatcher("/Admin.jsp").forward(request, response);
	}

	public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		doGet(request, response);
	}
}